package cn.lyjuan.android.demofive.ui.cut_animation;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import cn.lyjuan.android.demofive.R;

/**
 * Created by chad on 2016/6/17.
 */
public class CutAnimationActivity extends Activity
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        this.setContentView(R.layout.ui_cut_animation);

    }

    public void cut(View v)
    {
        int id = v.getId();

        Intent intent = new Intent(CutAnimationActivity.this, SecondActivity.class);
        String name = ((Button) v).getText().toString();
        intent.putExtra(SecondActivity.INTENT_KEY_NAME, name);
        this.startActivity(intent);
        switch (id)
        {
            case R.id.ui_cut_animation_alpha :// 淡入淡出
                this.overridePendingTransition(R.anim.ui_cut_animation_alpha_in, R.anim.ui_cut_animation_alpha_out);
                break;
            case R.id.ui_cut_animation_blow_up ://放大淡出
                this.overridePendingTransition(R.anim.ui_cut_animation_blow_up_in, R.anim.ui_cut_animation_out);
                break;
            case R.id.ui_cut_animation_rotate1 : // 旋转淡出1
                this.overridePendingTransition(R.anim.ui_cut_animation_rotate1_in, R.anim.ui_cut_animation_out);
                break;
            case R.id.ui_cut_animation_rotate2 : // 旋转淡出2
                this.overridePendingTransition(R.anim.ui_cut_animation_rotate2_in, R.anim.ui_cut_animation_out);
                break;
            case R.id.ui_cut_animation_left_up : // 左上角淡出
                this.overridePendingTransition(R.anim.ui_cut_animation_left_up_in, R.anim.ui_cut_animation_out);
                break;
            case R.id.ui_cut_animation_scale_zoom : // 压缩变小淡出
                this.overridePendingTransition(R.anim.ui_cut_animation_scale_zoom_in, R.anim.ui_cut_animation_scale_zoom_out);
                break;
            case R.id.ui_cut_animation_to_left : // 右往左推
                this.overridePendingTransition(R.anim.ui_cut_animation_to_left_in, R.anim.ui_cut_animation_to_left_out);
                break;
            case R.id.ui_cut_animation_to_up : // 下往上推
                this.overridePendingTransition(R.anim.ui_cut_animation_to_up_in, R.anim.ui_cut_animation_to_up_out);
                break;
            case R.id.ui_cut_animation_cross_hor : // 左右交叉
                this.overridePendingTransition(R.anim.ui_cut_animation_cross_hor_in, R.anim.ui_cut_animation_cross_hor_out);
                break;
            case R.id.ui_cut_animation_blow_up2 : // 放大淡出2
                this.overridePendingTransition(R.anim.ui_cut_animation_blow_up2_in, R.anim.ui_cut_animation_out);
                break;
            case R.id.ui_cut_animation_zoom_out : // 缩小淡出
                this.overridePendingTransition(R.anim.ui_cut_animation_zoom_out_in, R.anim.ui_cut_animation_zoom_out_out);
                break;
            case R.id.ui_cut_animation_cross_ver : // 上下淡出
                this.overridePendingTransition(R.anim.ui_cut_animation_cross_ver_in, R.anim.ui_cut_animation_cross_ver_out);
                break;
            case R.id.ui_cut_animation_filp : // 翻页
                this.overridePendingTransition(R.anim.ui_cut_animation_filp_in, R.anim.ui_cut_animation_filp_out);
                break;
            case R.id.ui_cut_animation_rotate_flip : // 旋转翻页
                this.overridePendingTransition(R.anim.ui_cut_animation_rotate_filp_in, R.anim.ui_cut_animation_rotate_filp_out);
                break;
            case R.id.ui_cut_animation_card_flip : // 卡牌翻页
                this.overridePendingTransition(R.anim.ui_cut_animation_card_flip_in, R.anim.ui_cut_animation_out);
                break;
        }

//        this.finish();
    }
}

